<template>
  <div class="box">
    <div class="title">
      <div class="circle"></div>
      <div>新建会员档案</div>
    </div>
    <p><span class="red">*</span>基本信息</p>
    <el-form :inline="true" :model="formInline" class="demo-form-inline">
      <el-form-item label="会员姓名:">
        <el-input v-model="formInline.user" placeholder="请输入文字" />
      </el-form-item>
      <el-form-item label="性别:">
        <el-select
          v-model="formInline.region"
          placeholder="请选择"
          style="width: 100px"
        >
          <el-option label="男" value="shanghai" />
          <el-option label="女" value="beijing" />
        </el-select>
      </el-form-item>
      <br />
      <el-form-item label="手机号码:">
        <el-input v-model="formInline.phone" placeholder="000-0000-0000" />
      </el-form-item>
      <br />

      <el-form-item label="家庭住址:">
        <el-input v-model="formInline.address" placeholder="请输入文字" />
      </el-form-item>
    </el-form>

    <el-form-item label="开卡日期:">
      <el-col :span="11">
        <el-date-picker
          v-model="sizeForm.date1"
          type="date"
          label="2022年12月14日"
          placeholder="2022年12月14日"
          style="width: 100%"
        />
      </el-col>
    </el-form-item>
    <!-- 开卡信息 -->
    <div class="card"><span class="red">*</span>开卡信息</div>
    <span class="money">充值金额：</span>
    <input type="text" class="money-box" />
    <span class="vip">金卡会员 可享受全店8折</span>
    <br />
    <input type="text" class="money-box silver" />
    <span class="vip">银卡会员 可享受全店9折</span>

    <div class="membercard">
      <span class="money">会员卡号：</span
      ><input type="text" placeholder="请扫描会员卡条形码" />
    </div>

    <!-- 缴费方式 -->
    <div class="pay">
      <div><span class="red">*</span>缴费方式：</div>
      <div class="WeChat">
        <img src="../../../assets/images/微信.png" alt="" />
      </div>
      <div class="alipay">
        <img src="../../../assets/images/支付宝.png" alt="" />
      </div>
    </div>
    <!-- <el-button type="primary" class="deposit">充值</el-button> -->

    <!-- 弹出框 -->
    <el-button text @click="centerDialogVisible = true"> 充值 </el-button>
    <el-dialog
      v-model="centerDialogVisible"
      title="会员信息详情"
      width="40%"
      align-center
      center="true"
    >
      <div class="message">
        <div class=""><span class="red">*</span><span>基本信息</span></div>
        <div>会员姓名：</div>
        <div>手机号码：</div>
        <div>家庭住址：</div>
        <div>会员编号：</div>
      </div>
      <div class="card-pay">
        <span class="red">*</span><span>会员卡消费信息</span>
      </div>
      <el-table :data="tableData" style="width: 100%">
        <el-table-column prop="date" label="消费时间" width="124" />
        <el-table-column prop="name" label="充值金额" width="124" />
        <el-table-column prop="address" label="消费金额" />
        <el-table-column prop="address" label="卡内余额" />
        <el-table-column prop="address" label="备注" />
      </el-table>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="centerDialogVisible = false">关闭</el-button>
          <!-- <el-button type="primary" @click="centerDialogVisible = false">
            Confirm
          </el-button> -->
        </span>
      </template>
    </el-dialog>
  </div>
</template>

<script lang="ts" setup>
import router from "@/router";
import { reactive } from "vue";
import { ref } from "vue";
const centerDialogVisible = ref(false);

//基本信息
const formInline = reactive({
  user: "",
  region: "",
  phone: "",
  address: "",
});

const onSubmit = () => {
  console.log("submit!");
};

const sizeForm = reactive({
  name: "",
  region: "",
  date1: "",
  date2: "",
  delivery: false,
  type: [],
  resource: "",
  desc: "",
});
//开卡信息

const input = ref("");

const tableData = ref([]);
</script>

<style lang="less" scoped>
.box {
  height: 100%;
  background: white;
  padding: 20px;
  .title {
    display: flex;
    align-items: center;
    color: #555555;
    font-size: 16px;
    margin-bottom: 25px;
    .circle {
      display: block;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: #555555;
      margin-right: 5px;
    }
  }
  .red {
    color: red;
  }

  .card {
    margin: 20px 0 10px 0;
  }
  .money {
    color: #888888;
  }
  .money-box {
    background: #ff7d7d;
    border: 0;
    color: white;
    text-align: center;
    height: 26px;
    width: 100px;
  }
  .vip {
    margin-left: 10px;
    color: #ccc;
    font-size: 12px;
  }
  .silver {
    margin-top: 10px;
    margin-left: 80px;
    background: #6096db;
  }
  .membercard {
    margin-top: 30px;
    margin-bottom: 40px;

    input {
      background: #f8f8f8;
      border: 0;
      height: 32px;
      width: 280px;
    }
  }
  .pay {
    display: flex;
    align-items: center;
    .WeChat img {
      width: 32px;
      height: 32px;
      margin-right: 10px;
    }
    .alipay img {
      width: 26px;
      height: 26px;
    }
  }

  .el-button {
    width: 80px;
    height: 32px;
    margin-top: 30px;
    margin-left: 80px;
    background: #ff7d7d;
    border: 0;
    border-radius: 0;
  }
  .el-dialog {
    .el-button {
      margin-left: 0;
    }
    .message div {
      margin-top: 10px;
    }
    .card-pay {
      margin-top: 30px;
      // color: black;
      font-weight: 600;
    }
  }
}
</style>
